<template>
  <div class="app-container">
    <!-- 搜索工作栏 -->
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="88px"
    >
      <!-- <el-form-item label="小程序编码" prop="appId">
        <el-input v-model="queryParams.appId" placeholder="请输入小程序编码" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item> -->
      <!-- <el-form-item label="授权第三方应用小程序id" prop="thirdAppId">
        <el-input v-model="queryParams.thirdAppId" placeholder="请输入授权第三方应用小程序id" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item> -->
      <el-form-item label="小程序名称" prop="appName">
        <el-input
          v-model="queryParams.appName"
          placeholder="请输入小程序名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="状态" prop="appState">
        <el-input
          v-model="queryParams.appState"
          placeholder="请输入状态"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="自动提审" prop="autoReview">
        <el-input v-model="queryParams.autoReview" placeholder="请输入自动提审" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item> -->
      <el-form-item label="授权日期" prop="updateTime">
        <el-date-picker
          v-model="queryParams.updateTime"
          style="width: 240px"
          value-format="yyyy-MM-dd HH:mm:ss"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="['00:00:00', '23:59:59']"
        />
      </el-form-item>
      <!-- <el-form-item label="授权人用户id" prop="authUserId">
        <el-input v-model="queryParams.authUserId" placeholder="请输入授权人用户id" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <!-- 操作工具栏 -->
    <el-row :gutter="10" class="mb8">
      <!-- <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['alipay:info-auth-ali-app:create']"
          >新增</el-button
        >
      </el-col> -->
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['alipay:info-auth-ali-app:appEmpower']"
          >授权支付宝小程序</el-button
        >
      </el-col>
      <!-- <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          :loading="exportLoading"
          v-hasPermi="['alipay:info-auth-ali-app:export']"
          >导出</el-button
        >
      </el-col> -->
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>

    <!-- 列表 -->
    <el-table v-loading="loading" border :data="list">
      <!-- <el-table-column label="内码" align="center" prop="id" /> -->
      <el-table-column label="小程序编码" align="center" prop="appId" />
      <!-- <el-table-column label="授权第三方应用小程序id" align="center" prop="thirdAppId" /> -->
      <el-table-column label="小程序名称" align="center" prop="appName" />
      <el-table-column label="应用logo" align="center" prop="appLogo">
        <template v-slot="scope">
          <img
            class="img"
            width="30px"
            height="30px"
            :src="scope.row.appLogo"
          />
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" prop="appState" />
      <el-table-column label="自动提审" align="center" prop="autoReview">
        <template v-slot="scope">
          <span>{{ scope.row.autoReview == 0 ? "否" : "是" }}</span>
        </template>
      </el-table-column>

      <!-- <el-table-column label="授权token" align="center" prop="appAuthToken" /> -->
      <!-- <el-table-column label="授权返回code" align="center" prop="appAuthCode" /> -->
      <el-table-column label="授权日期" align="center" prop="updateTime">
        <template v-slot="scope">
          <span>{{ parseTime(scope.row.updateTime) }}</span>
        </template>
      </el-table-column>
      <!-- <el-table-column label="授权人用户id" align="center" prop="authUserId" /> -->
      <el-table-column label="线上版本" align="center" prop="onlineVersion" />
      <el-table-column
        label="开发版本"
        align="center"
        prop="developmentVersion"
      />
      <el-table-column label="用户统计" align="center" prop="usageQuantity" />
      <el-table-column label="驳回原因" align="center" prop="rejectMessage" />
      <el-table-column
        label="创建时间"
        align="center"
        prop="createTime"
        width="180"
      >
        <template v-slot="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template v-slot="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['alipay:info-auth-ali-app:update']"
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['alipay:info-auth-ali-app:delete']"
            >删除</el-button
          >
          <el-button
            size="mini"
            type="text"
            v-if="scope.row.operateStatue == '0'"
            @click="handleDelete(scope.row)"
            >上传代码</el-button
          >
          <el-button
            size="mini"
            type="text"
            v-if="scope.row.operateStatue == '1'"
            @click="handAuditing(scope.row)"
            >提交审核</el-button
          >
          <el-button
            size="mini"
            type="text"
            v-if="scope.row.operateStatue == '1'"
            @click="deleteVersion(scope.row)"
            >删除版本</el-button
          >
          <el-button
            size="mini"
            type="text"
            v-if="scope.row.operateStatue == '2'"
            @click="cancleAppVersion(scope.row)"
            >撤销审核</el-button
          >
          <el-button
            size="mini"
            type="text"
            v-if="scope.row.operateStatue == '3'"
            @click="handleRelease(scope.row)"
            >发布</el-button
          >
          <el-button
            size="mini"
            type="text"
            v-if="scope.row.operateStatue == '4'"
            @click="handleRelease(scope.row)"
            >下架</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNo"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <!-- <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:role:create']"
          >授权支付宝小程序</el-button
        >
      </el-col>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row> -->

    <!-- <el-table v-loading="loading" :data="roleList">
      <el-table-column
        label="小程序名称"
        align="center"
        prop="buyerId"
        width="160"
      />
      <el-table-column
        label="头像"
        align="center"
        prop="outTradeNo"
        :show-overflow-tooltip="true"
        width="160"
      />
      <el-table-column
        label="用户统计"
        align="center"
        prop="familyName"
        width="100"
      />
      <el-table-column label="小程序编码" prop="solarDate" width="120" />
      <el-table-column label="开发版本" prop="costPrise" width="120" />
      <el-table-column label="线上版本" prop="retailPrise" width="120" />
      <el-table-column label="自动提审" prop="retailPrise" width="120" />
      <el-table-column label="授权时间" prop="retailPrise" width="120" />
      <el-table-column label="状态" prop="retailPrise" width="120" />
      <el-table-column label="驳回原因" prop="retailPrise" width="120" />

      <el-table-column label="订单状态" prop="orderStatues" width="80">
        <template v-slot="scope">
          <dict-tag
            :type="DICT_TYPE.CMS_BBNAMES_ORDERS_STATE"
            :value="scope.row.orderStatues"
          />
        </template>
      </el-table-column>
      <el-table-column
        label="创建时间"
        align="center"
        prop="createTime"
        width="180"
      >
        <template v-slot="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="订单创建时间"
        align="center"
        prop="orderTime"
        class-name="small-padding fixed-width"
      >
        <template v-slot="scope">
          <span>{{ parseTime(scope.row.orderTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template v-slot="scope">
          <el-button
            type="primary"
            icon="el-icon-search"
            size="mini"
            @click="handleQuery"
            >操作</el-button
          >
        </template>
      </el-table-column>
    </el-table> -->

    <!-- <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNo"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    /> -->
    <!-- 对话框(添加 / 修改) -->
    <el-dialog
      :title="title"
      :visible.sync="open"
      width="500px"
      v-dialogDrag
      append-to-body
    >
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="小程序编码" prop="appId">
          <el-input v-model="form.appId" placeholder="请输入小程序编码" />
        </el-form-item>
        <el-form-item label="授权第三方应用小程序id" prop="thirdAppId">
          <el-input
            v-model="form.thirdAppId"
            placeholder="请输入授权第三方应用小程序id"
          />
        </el-form-item>
        <el-form-item label="小程序名称" prop="appName">
          <el-input v-model="form.appName" placeholder="请输入小程序名称" />
        </el-form-item>
        <el-form-item label="应用logo" prop="appLogo">
          <el-input v-model="form.appLogo" placeholder="请输入应用logo" />
        </el-form-item>
        <el-form-item label="状态" prop="appState">
          <el-input v-model="form.appState" placeholder="请输入状态" />
        </el-form-item>
        <el-form-item label="自动提审" prop="autoReview">
          <el-input v-model="form.autoReview" placeholder="请输入自动提审" />
        </el-form-item>
        <el-form-item label="授权token" prop="appAuthToken">
          <el-input v-model="form.appAuthToken" placeholder="请输入授权token" />
        </el-form-item>
        <el-form-item label="授权返回code" prop="appAuthCode">
          <el-input
            v-model="form.appAuthCode"
            placeholder="请输入授权返回code"
          />
        </el-form-item>
        <el-form-item label="授权日期" prop="authTime">
          <el-date-picker
            clearable
            v-model="form.authTime"
            type="date"
            value-format="timestamp"
            placeholder="选择授权日期"
          />
        </el-form-item>
        <el-form-item label="授权人用户id" prop="authUserId">
          <el-input
            v-model="form.authUserId"
            placeholder="请输入授权人用户id"
          />
        </el-form-item>
        <el-form-item label="线上版本" prop="onlineVersion">
          <el-input v-model="form.onlineVersion" placeholder="请输入线上版本" />
        </el-form-item>
        <el-form-item label="开发版本" prop="developmentVersion">
          <el-input
            v-model="form.developmentVersion"
            placeholder="请输入开发版本"
          />
        </el-form-item>
        <el-form-item label="用户统计" prop="usageQuantity">
          <el-input v-model="form.usageQuantity" placeholder="请输入用户统计" />
        </el-form-item>
        <el-form-item label="驳回原因" prop="rejectMessage">
          <el-input v-model="form.rejectMessage" placeholder="请输入驳回原因" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <!-- <el-button type="primary" @click="submitForm">确 定</el-button> -->
        <!-- <el-button @click="cancel">取 消</el-button> -->
      </div>
    </el-dialog>

    <!-- 授权弹框 -->
    <el-dialog
      title="支付宝小程序授权"
      :visible.sync="dialogVisible"
      width="80%"
      :before-close="handleClose"
    >
      <div class="zfbBox">
        <div class="list" v-for="item in distributionAppList" :key="item.id">
          <img class="img" :src="item.appShowImage" />
          <div class="title">{{ item.appName }}</div>
          <el-button
            icon="el-icon-circle-check"
            size="small"
            :type="currentSelectedAppId === item.appId ? 'primary' : 'default'"
            @click="selectZfb(item)"
            >选择</el-button
          >
        </div>
        <!-- :plain="currentSelectedAppId === item.appId" -->

        <!-- <div class="list">
          <img
            class="img"
            src="https://vipkky.oss-cn-nanjing.aliyuncs.com/hotel/c355828464f7ada1a36041dcfa4236a.png"
          />
          <div class="title">酒店小程序</div>
          <el-button
            type="primary"
            icon="el-icon-circle-check"
            size="small"
            plain
            @click="selectZfb"
            >选择</el-button
          >
        </div> -->
      </div>
      <div class="describe">
        <div class="">{{ defSelectObj.appName }}：</div>
        <div class="">
          {{ defSelectObj.appRemark }}
          <a :href="defSelectObj.appDoc" style="color: #1890ff"
            >《{{ defSelectObj.appName }}教程》</a
          >
        </div>
        <div class="proclaim">
          <el-checkbox v-model="checked"></el-checkbox>
          我已认真阅读<a
            href="https://opendocs.alipay.com/b/0a8w4g"
            target="_blank"
            style="color: red"
            >《支付宝小程序基本信息规范》</a
          >严格遵守支付宝小程序运营规范及法律法规，如违反以上条款我愿为此独立承担一切责任，与同锦开放平台平台无关。
        </div>
      </div>
      <div class="authorize" v-if="checked == true">
        <el-button type="primary" @click="bandDeauthorization"
          >前往授权</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { getBbNamesOrders } from "@/api/distribute/order";
import CryptoJS from 'crypto-js';
import {
  getInfoThirdAliAppPage,
  uploadAppVersion,
  auditAppVersion,
  onlineAppVersion,
  deleteAppVersion,
  cancelAuditAppVersion,
} from "@/api/alipay/infoThirdAliApp";
import {
  createInfoAuthAliApp,
  updateInfoAuthAliApp,
  deleteInfoAuthAliApp,
  getInfoAuthAliApp,
  getInfoAuthAliAppPage,
  exportInfoAuthAliAppExcel,
} from "@/api/alipay/infoAuthAliApp";

import { getUserProfile } from "@/api/system/user";
export default {
  name: "NamesIndex",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 查询参数
      queryParams: {
        pageVO: "",
        pageNo: 1,
        pageSize: 10,
        creator: "",
      },
      // 表单参数
      form: {},
      defaultProps: {
        label: "name",
        children: "children",
      },
      roleList: [],

      dialogVisible: false,
      checked: false,
      distributionAppList: [],
      defSelectObj: {},
      authorizeInfo: {},
      sysUserId: null,
      rules: {},
      open: false,
      title: "从而产生大多数",
      list: [],
      currentSelectedAppId: null,
    };
  },
  created() {
    this.getList();
    this.getUserInfo();
    this.getAppList();
  },
  methods: {
    /** 获取地址栏的参数*/
    // getLocationlink() {
    //   var urlParams = new URLSearchParams(window.location.search);
    //   var app_auth_code = urlParams.get("app_auth_code") || undefined;
    //   var app_id = urlParams.get("app_id") || undefined;
    //   var sysUserId = urlParams.get("id") || undefined;
    //   this.app_auth_code = app_auth_code;
    //   this.app_id = app_id; //第三方应用id
    //   this.sysUserId = sysUserId;
    //   console.log(app_auth_code); // 输出: "P0a26764e3b7d4a559479d38d496ec87"
    //   console.log(app_id); // 输出: "2021004134651039"
    //   if (app_auth_code) {
    //     this.getToken(app_auth_code);
    //   }
    // },
    // getToken(app_auth_code) {
    //   const that = this;
    //   const reqBody = {
    //     grantType: "authorization_code",
    //     code: app_auth_code,
    //   };
    //   getAppAuthTokenByCode(reqBody).then((res) => {
    //     console.log("我来授权了", res);
    //     const authorizeInfo = res.data.alipay_open_auth_token_app_response;
    //     this.authorizeInfo = authorizeInfo;
    //     that.createApp();
    //   });
    // },
    // createApp() {
    //   const authTime = this.getDate();
    //   console.log("authTime", authTime);

    //   const reqBody = {
    //     appId: this.authorizeInfo.auth_app_id,
    //     thirdAppId: this.app_id,
    //     appName: "同锦起名",
    //     appLogo:
    //       "https://gw.alipayobjects.com/mdn/rms_d00b4e/afts/img/A*kgFUSaH_WzEAAAAAAAAAAAAAARQnAQ",
    //     authTime: authTime,
    //     authUserId: this.authorizeInfo.user_id,
    //     sysUserId: this.sysUserId, //系统租户id
    //     usageQuantity: 0,
    //   };
    //   createAlipayApp(reqBody).then((res) => {
    //     console.log("创建成功", res);
    //   });
    // },
    getDate() {
      let time = new Date();
      console.log(time);
      //Fri Apr 15 2022 10:37:52 GMT+0800 (中国标准时间)
      var y = time.getFullYear();
      var m = (time.getMonth() + 1).toString().padStart(2, "0");
      //0-11月，0代表一月，所以获取当前月份要加1
      //用padStart方法，不足两位数，在前面添加0，以下同理
      var d = time.getDate().toString().padStart(2, "0");
      var hh = time.getHours().toString().padStart(2, "0");
      var mm = time.getMinutes().toString().padStart(2, "0");
      var ss = time.getSeconds().toString().padStart(2, "0");
      //yyyy-MM-dd HH:mm:ss
      return y + "-" + m + "-" + d + " " + hh + ":" + mm + ":" + ss;
    },
    /** 查询角色列表 */
    getList() {
      this.loading = true;
      // 执行查询
      getInfoAuthAliAppPage(this.queryParams).then((response) => {
        this.list = response.data.list;
        this.total = response.data.total;
        this.loading = false;
      });
    },
    // 获取用户信息
    getUserInfo() {
      getUserProfile().then((response) => {
        this.user = response.data;
        this.queryParams.creator = response.data.id;
        this.sysUserId = btoa(response.data.id);
        this.getList();
      });
    },
    handleExport() {},
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 取消按钮（数据权限）
    cancelDataScope() {
      this.openDataScope = false;
      this.reset();
    },
    // 取消按钮（菜单权限）
    cancelMenu() {
      this.openMenu = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        appId: undefined,
        thirdAppId: undefined,
        appName: undefined,
        appLogo: undefined,
        appState: undefined,
        autoReview: undefined,
        appAuthToken: undefined,
        appAuthCode: undefined,
        authTime: undefined,
        authUserId: undefined,
        onlineVersion: undefined,
        developmentVersion: undefined,
        usageQuantity: undefined,
        rejectMessage: undefined,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNo = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    handleAdd() {
      // this.getURlCode();
      this.dialogVisible = true;
    },
    selectZfb(item) {
      console.log(item);
      this.currentSelectedAppId = item.appId;
      this.defSelectObj = item;
      // isSelectApplet = true;
    },
    getAppList() {
      getInfoThirdAliAppPage(this.queryParams).then((response) => {
        this.distributionAppList = response.data.list;
        this.currentSelectedAppId = response.data.list[0].appId;
        this.defSelectObj = response.data.list[0];
      });
    },
    // getURlCode() {
    //   // 拼接的系统用户id值

    //   var idToAppend = this.user.id;

    //   const list = this.distributionAppList;

    //   // 遍历数组
    //   list.forEach((item) => {
    //     // 判断courseLink是否为需要转码并拼接的格式
    //     if (item.appAuthUrl.includes("bizData")) {
    //       // 解码JSON字符串
    //       var bizDataJson = decodeURIComponent(item.appAuthUrl.split("=")[1]);
    //       var bizDataObject = JSON.parse(bizDataJson);

    //       // 拼接查询参数
    //       var uriWithQuery =
    //         bizDataObject.agentOpParam.redirectUri +
    //         "?id=" +
    //         encodeURIComponent(idToAppend);

    //       // 更新bizDataObject中的redirectUri，并重新编码整个bizData部分
    //       bizDataObject.agentOpParam.redirectUri = uriWithQuery;
    //       item.appAuthUrl =
    //         "https://b.alipay.com/page/message/tasksDetail?bizData=" +
    //         encodeURIComponent(JSON.stringify(bizDataObject));
    //     } else {
    //       // 对于非特殊格式的链接直接拼接
    //       item.appAuthUrl += "?id=" + encodeURIComponent(idToAppend);
    //     }
    //   });

    //   console.log("list", list);
    //   // // 假设你有一个包含完整URL的变量url
    //   // var url =
    //   //   "https://b.alipay.com/page/message/tasksDetail?bizData=%7B%22platformCode%22%3A%22O%22%2C%22taskType%22%3A%22INTERFACE_AUTH%22%2C%22agentOpParam%22%3A%7B%22redirectUri%22%3A%22http%3A%2F%2Fexpress.qqorw.com%22%2C%22appTypes%22%3A%5B%22TINYAPP%22%2C%22WEBAPP%22%2C%22PUBLICAPP%22%5D%2C%22isvAppId%22%3A%222021004134651039%22%7D%7D";

    //   // // 获取查询参数bizData的值并解码
    //   // var query = new URL(url).searchParams.get("bizData");
    //   // var bizDataJson = decodeURIComponent(query);

    //   // // 将解码后的JSON字符串转换成JavaScript对象
    //   // var bizDataObject = JSON.parse(bizDataJson);
    //   // console.log(bizDataObject);
    //   // console.log(bizDataObject.agentOpParam.redirectUri);
    // },
    handleClose() {
      this.dialogVisible = false;
    },
    bandDeauthorization() {
      this.dialogVisible = false;
      const bizDataObj = {
        platformCode: "O",
        taskType: "INTERFACE_AUTH",
        agentOpParam: {
          redirectUri: "https://www.3r8.cn/admin-api/alipay/info-auth-ali-app/callback",
          appTypes: ["TINYAPP", "WEBAPP", "PUBLICAPP", "MOBILEAPP"],
          isvAppId: this.defSelectObj.appId,
          state: this.sysUserId,
        },
      };
      const bizData = encodeURIComponent(JSON.stringify(bizDataObj));
      const link = `https://b.alipay.com/page/message/tasksDetail?bizData=${bizData}`;
      console.log(link);
      // window.location.href = appAuthUrl;
      window.open(link, "_blank");
    },
    // 上传代码
    handleDelete(row) {
      const that = this;
      const reqBody = {
        authAppId: row.id,
      };
      uploadAppVersion(reqBody).then((res) => {
        const { code, subMsg } = res.data;
        if (code === "10000") {
          this.$message({
            message: "上传成功",
            type: "success",
          });
          that.getList();
        } else {
          this.$message({
            message: subMsg,
            type: "error",
          });
        }
      });
    },

    // 提交审核
    handAuditing(row) {
      const that = this;
      const reqBody = {
        authAppId: row.id,
      };
      auditAppVersion(reqBody).then((res) => {
        console.log("提交审核", res.data);
        const { code, subMsg } = res.data;
        if (code === "10000") {
          this.$message({
            message: "提交审核成功",
            type: "success",
          });
          that.getList();
        } else {
          this.$message({
            message: subMsg,
            type: "error",
          });
        }
      });
    },

    // 删除版本
    deleteVersion(row) {
      const that = this;
      const reqBody = {
        authAppId: row.id,
      };
      deleteAppVersion(reqBody).then((res) => {
        console.log("删除版本", res);
        const { code, subMsg } = res.data;
        if (code === "10000") {
          this.$message({
            message: "删除成功",
            type: "success",
          });
          that.getList();
        } else {
          this.$message({
            message: subMsg,
            type: "error",
          });
        }
      });
    },
    //撤销审核
    cancleAppVersion(row) {
      const that = this;
      const reqBody = {
        authAppId: row.id,
      };
      cancelAuditAppVersion(reqBody).then((res) => {
        console.log("撤销审核", res);
        const { code, subMsg } = res.data;
        if (code === "10000") {
          this.$message({
            message: "撤销审核成功",
            type: "success",
          });
          that.getList();
        } else {
          this.$message({
            message: subMsg,
            type: "error",
          });
        }
      });
    },
    // 发布版本
    handleRelease(row) {
      const reqBody = {
        authAppId: row.id,
      };
      onlineAppVersion(reqBody).then((res) => {
        console.log("发布", res);
        const { code, subMsg } = res.data;
        if (code === "10000") {
          this.$message({
            message: "发布成功",
            type: "success",
          });
        } else {
          this.$message({
            message: subMsg,
            type: "error",
          });
        }
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.el-dialog ::v-deep .el-dialog__header {
  border-bottom: 1px solid #e8e8e8 !important;
}
.zfbBox {
  display: flex;
  align-items: center;
  text-align: center;
  // justify-content: space-between;
  .list {
    padding-right: 20px;
    .img {
      width: 180px;
      height: 420px;
    }
    .title {
      padding-top: 20px;
      padding-bottom: 20px;
    }
  }
}
.describe {
  margin-top: 20px;
  .proclaim {
    padding-top: 20px;
  }
}
.authorize {
  margin-top: 20px;
  text-align: center;
}
</style>
